<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>温湿度列表</title>
    <script src="/js/echarts.min.js" type="text/javascript"></script>
    <script src="/layui/jquery-1.10.2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="hum" style="width: 1200px;height:400px;"></div>
<div id="temp" style="width: 1200px;height:400px;"></div>
</body>

<script type="text/javascript">
    var hum = echarts.init(document.getElementById('hum'));
    var temp = echarts.init(document.getElementById('temp'));

    $.get('/humitures/humitures').done(function (data) {
            hum.setOption({
                title: {
                    text: '湿度折线图'
                },
                tooltip: {},
                legend: {
                    data: ['湿度']
                },
                xAxis: {
                    data: data.result.times
                },
                yAxis: {},
                series: [{
                    name: '湿度百分比',
                    type: 'line',
                    data: data.result.humidityList
                }]
            });
            temp.setOption({
                title: {
                    text: '温度折线图'
                },
                tooltip: {},
                legend: {
                    data: ['温度']
                },
                xAxis: {
                    data: data.result.times
                },
                yAxis: {},
                series: [{
                    name: '温度',
                    type: 'line',
                    data: data.result.temperatureList
                }]
            });
        }
    );
</script>
</html>